import request from "@/utils/request"
// 采购 历史下单价格
export function purchaseHistoryList(data) {
  return request({
    baseURL: window.APP_GETEWAY.pms,
    url: `/v1/purchase/purchase-process/history-list`,
    method: "post",
    data,
  })
}
// 采购 获取采购记录 新 http://10.20.9.32:40001/project/91/interface/api/24514
export function listingPurchaseHistoryList(data) {
  return request({
    url: "/listing/purchase-history-list",
    method: "post",
    data,
  })
}

// 获取仓库option
export const getWarehouseOptions = (params = { status: 1 }) => {
  return request({
    baseURL: window.APP_GETEWAY.wms,
    url: "/api/warehouse-option",
    method: "get",
    params,
  })
}

export const ownerInventory = (data) => {
  return request({
    baseURL: window.APP_GETEWAY.wms,
    url: `/api/owner-inventory`,
    method: "post",
    data,
  })
}
export const inventoryPlatformStat = (data) => {
  return request({
    baseURL: window.APP_GETEWAY.wms,
    url: `/api/sea-inventory-platform-stat`,
    method: "post",
    data,
  })
}

export const fbaOrderGetOpt = (params) => {
  return request({
    baseURL: window.APP_GETEWAY.tc,
    url: `/tc_v1_pc/fba-order/get-opt`,
    method: "get",
    params,
  })
}

// 头程列表
export const amazonListingOrderList = (data) => {
  return request({
    baseURL: window.APP_GETEWAY.tc,
    url: `/v1/order/amazon-listing/order-list`,
    method: "post",
    data,
  })
}
// 头程待发货记录
export const amazonListingWaitShipOrderList = (data) => {
  return request({
    baseURL: window.APP_GETEWAY.tc,
    url: `/v1/order/amazon-listing/wait-ship-order-list`,
    method: "post",
    data,
  })
}

// 获取站点下拉列表
export const apiGetPlatformSites = (params) => {
  return request({
    baseURL: window.APP_GETEWAY.base,
    url: "/v1/platform/sites",
    method: "get",
    params,
  })
}
// 获取店铺下拉列表
export const getShop = (data) => {
  return request({
    baseURL: window.APP_GETEWAY.base,
    url: "/v1/shop/drop-list",
    method: "post",
    data,
  })
}

// 获取历史销量
export const historySalesVolume = (params) => {
  return request({
    url: "/listing/history-sales-volume",
    method: "get",
    params,
  })
}
// listing列表
export const amazonListingList = (data) => {
  return request({
    // baseURL: window.APP_GETEWAY.listing,
    url: "/listing/list",
    method: "post",
    data,
  })
}
// 系统预估销量设置
export const amazonSalesSetting = (data) => {
  return request({
    url: "/listing/sys-sales-setting",
    method: "post",
    data,
  })
}
// 获取预估销量配置
export const amazonSalesVolume = (params) => {
  return request({
    url: "/listing/sys-sales-volume",
    method: "get",
    params,
  })
}
// 日志
export const listingLog = (params) => {
  return request({
    url: "/log/index",
    method: "get",
    params,
  })
}
// 导出历史商品销量数据
export const historySalesExport = (data) => {
  return request({
    url: "/listing/history-sales-export",
    method: "post",
    data,
  })
}

// 刊登-listing收货     http://10.20.9.32:40001/project/65/interface/api/22887
export const listingGetGoods = (data) => {
  return request({
    baseURL: window.APP_GETEWAY.wms,
    url: "/api/listing-get-goods",
    method: "post",
    data,
  })
}

// 刊登-listing收货     http://10.20.9.32:40001/project/91/interface/api/23469
export const ratioSalesQty = (params) => {
  return request({
    url: "/listing/ratio-sales-qty",
    method: "get",
    params,
  })
}

// TEMU
// 供货价维护
export const updateGoodsPrice = (data) => {
  return request({
    url: "/listing/update-goods-price",
    method: "post",
    data,
  })
}
